From 3bcf69a3b6fe4ce4f9cb36f69015a4b2f78c864e Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 25 Sep 2006 09:36:11 +0100 Subject: [PATCH] Consolidate the preferable use of a pragma with the feature detection in the make script. Signed-off-by: Jan Beulich --- xen/arch/x86/Rules.mk | 2 +- xen/include/xen/compiler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index 32c8e02695..176d6aebf4 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -44,7 +44,7 @@ CFLAGS += -mno-red-zone -fpic -fno-reorder-blocks CFLAGS += -fno-asynchronous-unwind-tables # -fvisibility=hidden reduces -fpic cost, if it's available CFLAGS += $(shell $(CC) -v --help 2>&1 | grep " -fvisibility=" | \ - grep -q hidden && echo "-fvisibility=hidden") + grep -q hidden && echo "-DGCC_HAS_VISIBILITY_ATTRIBUTE") LDFLAGS += -m elf_x86_64 x86_32 := n x86_64 := y diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h index d70833efb5..85d6cee5f1 100644 --- a/xen/include/xen/compiler.h +++ b/xen/include/xen/compiler.h @@ -35,7 +35,7 @@ #define offsetof(a,b) ((unsigned long)&(((a *)0)->b)) #endif -#if defined(__x86_64__) && (__GNUC__ > 3) +#ifdef GCC_HAS_VISIBILITY_ATTRIBUTE /* Results in more efficient PIC code (no indirections through GOT or PLT). */ #pragma GCC visibility push(hidden) #endif -- 2.30.2